package gof_003_行为型_Behavioral.gof_005_责任链_ChainOfResponsibility.gof_002_Chain;

public class Chain {

    /**
     * 装配责任链
     */
    public static void start(AskForLeave askForLeave) {
        //构建角色
        Leader leaderGroup = new LeaderGroup("赵组长");
        Leader leaderManager = new LeaderManager("钱经理");
        Leader leaderBoss = new LeaderBoss("孙老板");

        //责任链装配角色
        leaderGroup.setNewLeader(leaderManager);
        leaderManager.setNewLeader(leaderBoss);


        //进入流程
        leaderGroup.handle(askForLeave);
    }
}
